package cn.pet.service.manage.service.impl;

import cn.pet.service.manage.entity.PetComment;
import cn.pet.service.manage.entity.dto.CommentSearch;
import cn.pet.service.manage.entity.vo.CommentList;
import cn.pet.service.manage.mapper.PetCommentMapper;
import cn.pet.service.manage.service.PetCommentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 评论表 服务实现类
 * </p>
 *
 * @author 
 * @since 2023-02-11
 */
@Service
public class PetCommentServiceImpl extends ServiceImpl<PetCommentMapper, PetComment> implements PetCommentService {

    @Override
    public List<CommentList> listByPage(CommentSearch search) {
        PageHelper.startPage(search.getPageNum(),search.getPageSize());
        return this.baseMapper.queryList(search);
    }

    @Override
    public List<CommentList> listByGoodsId(Integer goodsId) {
        return this.baseMapper.queryByGoodId(goodsId);
    }
}
